from jinja2 import Environment, FileSystemLoader

import App_setting as setting


def render_template(filename: str, **kwargs) -> str:
    jinja2_env = Environment(loader=FileSystemLoader(setting.path.dir_html_static_folder))
    template = jinja2_env.get_template(filename)
    rendered_template = template.render(**kwargs)
    return rendered_template
